ScMobileApp.PopupView = Ember.View.extend({
	templateName: "popup",
	classNames: ["popup"],
	close: function(){
		this.destroy();
	},
	didInsertElement: function(){
		ScLibs.ui.Dialog.show(this.$());

		this.eventBind();
	},
	eventBind: function(){
		this.$().find("button").click(function(e){
			ScMobileApp.PopupView.close();
		});
	},
	getData: function(){
		
	}
});


ScMobileApp.PopupView.reopenClass({
	modal: null,
	open: function(){
		this.modal = this.create();
		this.modal.appendTo("body");
	},
	close: function(){
		var promise = ScLibs.ui.Dialog.hide(this.modal.$());
		promise.done($.proxy(function(){
			this.modal.close();
			this.modal = null;
		}, this));
	}
});